feat(mcp): remote servers and duplicate detection#131
Merged
gblanc-1a merged 9 commits intoAmadeusITGroup:mainfrom Jan 28, 2026
Merged
Conversation
The generate-manifest.js script was not copying the mcp/mcpServers field from collection YAML files to the generated deployment-manifest.yml. This caused GitHub Release bundles to have no MCP server definitions, resulting in the extension skipping MCP installation. Changes: - Extract mcpServers from collection.mcpServers or collection.mcp.items - Include mcpServers in the deployment manifest when present - Add logging for MCP servers count in build output - Bump package version to 1.0.0 (first stable release with MCP support) This matches the behavior of AwesomeCopilotAdapter which supports both mcp.items (schema format) and mcpServers (manifest format). Fixes MCP servers not being installed from GitHub Release bundles. Collections will need to rebuild and republish releases for the fix to take effect.
- Add type guards isStdioServerConfig() and isRemoteServerConfig() for proper discrimination between stdio (local process) and remote (HTTP/SSE) servers - Refactor processServerDefinition() to handle both server types with variable substitution for URLs and headers - Add computeServerIdentity() to compute unique identity for duplicate detection: - Stdio: command + args - Remote: url - Add detectAndDisableDuplicates() to automatically disable duplicate servers while keeping the first installed active - Integrate duplicate detection into McpServerManager.installServers() - Use jsonc-parser for reading mcp.json to handle VS Code's JSONC format (trailing commas, comments) - Update MarketplaceViewProvider to display both stdio and remote server types - Add comprehensive TDD tests (43 new tests): - Type guard tests - Remote server processing tests - Duplicate detection tests - Lifecycle tests (install multiple, remove gradually) - Update documentation: - author-guide/collection-schema.md: remote server examples, duplicate behavior - contributor-guide/architecture/mcp-integration.md: algorithm details, flowchart BREAKING CHANGE: McpServerDefinition type now includes remote server configs
d869fa9 to
d10a3b2
Compare
28 tasks
gblanc-1a
reviewed
Jan 27, 2026
Contributor
gblanc-1a
left a comment
There was a problem hiding this comment.
- I think we might need to add the mcp as part of the lockfile too to be aware of which package installed which mcp at some point.
- I tried to generate a repository on my side with it to try doing a bit of QA with it but didn't manage to make it work in local. I probably miss something
Contributor
There was a problem hiding this comment.
I think it would be good to add one HTTP mcp server as example and part of the scaffolding
added 7 commits
January 27, 2026 22:23
- Add jsonc-parser to production dependencies (Critical) - Add HTML escaping to prevent XSS in MCP server display (High) - Replace (config as any) casts with proper type narrowing using McpStdioServerConfig and McpRemoteServerConfig types (Medium) - Add reEnableDuplicatesAfterRemoval() to automatically re-enable duplicate servers when the active server is uninstalled (Medium) All 2377 tests passing.
…cards - Fix type guard isRemoteServerConfig() to infer remote server when url is present without command (common in YAML configs without explicit type) - Update isStdioServerConfig() to be consistent with remote detection - Add MCP servers count to bundle card content breakdown display - Add countMcpServers() helper to extract count from bundle/manifest data - Show '🔌 MCP Servers' in marketplace bundle cards alongside other content This fixes duplicate detection not working when YAML configs don't explicitly set type: http/sse, and makes MCP servers visible to users before installation.
Add OPTION 2 section with remote MCP server examples: - HTTP endpoint with authentication headers - SSE streaming endpoint - GitHub Copilot MCP endpoint example Renumber custom local server to OPTION 3.
- GitHubAdapter: attach mcpServers from manifest to bundle object - GitLabAdapter: attach both prompts and mcpServers from manifest This enables the marketplace to show MCP servers count in bundle cards before installation, not just after.
Add MCP servers count with 🔌 icon to the bundle details page content breakdown section, consistent with the marketplace tile display.
…pters - AwesomeCopilotAdapter: extract mcpServers, attach to bundle, include in breakdown - LocalAwesomeCopilotAdapter: same changes for local collections - Update calculateBreakdown() to accept optional mcpServers parameter This ensures MCP servers count is available in the pre-calculated breakdown used by the marketplace for pre-installation display.
gblanc-1a
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive support for remote MCP servers (HTTP/SSE) and implements automatic duplicate detection to prevent conflicts when multiple collections define the same MCP server.
Key improvements:
mcp.jsonformat (trailing commas, comments)Type of Change
Related Issues
Relates to MCP integration improvements and collection schema enhancements.
Changes Made
Type System
isStdioServerConfig()andisRemoteServerConfig()type guards for proper server type discriminationMcpServerDefinitionto support union of stdio and remote server configsCore Functionality
McpConfigService.processServerDefinition()to handle both stdio and remote (HTTP/SSE) servers${env:API_TOKEN})computeServerIdentity()to generate unique identities:stdio:{command}:{args|joined|by|pipe}remote:{url}detectAndDisableDuplicates()that:jsonc-parserto handle VS Code'smcp.jsonformat (trailing commas, comments)Integration
McpServerManager.installServers()lifecycleMarketplaceViewProviderto display both stdio (⚡) and remote (🌐) server types with appropriate detailsDocumentation
docs/author-guide/collection-schema.md): Added remote server examples and duplicate detection behaviordocs/contributor-guide/architecture/mcp-integration.md): Added algorithm details, flowchart, and type guard documentation.kiro/specs/mcp-remote-servers/design.md): Comprehensive design rationale and implementation detailsTesting
Test Coverage
43 new tests added:
McpConfigService.remoteServers.test.ts(22 tests): Type guards, remote server processing, variable substitutionMcpConfigService.duplicateDetection.test.ts(16 tests): Identity computation, duplicate detection logic, edge casesMcpConfigService.duplicateLifecycle.test.ts(5 tests): Install multiple collections, gradual removal, invariant verificationTest Results:
Manual Testing Steps
mcp.jsonmcp.jsonTested On
Screenshots
N/A - Backend changes with no UI modifications (except MCP server display icons)
Checklist
Documentation
docs/author-guide/collection-schema.md- Remote server examples, duplicate behaviordocs/contributor-guide/architecture/mcp-integration.md- Algorithm details, flowchart.kiro/specs/mcp-remote-servers/design.md- Design documentAdditional Notes
Breaking Change
The
McpServerDefinitiontype now includes remote server configurations. Existing code that assumes all MCP servers are stdio-based may need updates. However, the change is backward compatible for collection manifests - existing stdio servers continue to work without modification.JSONC Parser
The switch to
jsonc-parserfixes a critical bug where VS Code'smcp.jsonfiles with trailing commas or comments would fail to parse. This is a common issue since VS Code's JSON editor allows these by default.Duplicate Detection Algorithm
The algorithm is designed to be transparent and predictable:
Reviewer Guidelines
Please pay special attention to:
computeServerIdentity()anddetectAndDisableDuplicates()for edge casesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.